import { domainService } from '~/config/server'
import { NetService } from '~/utils/net.service'
import { Inject, Debounce } from "~/core/decorator";

export class HomePageService {

  @Inject(NetService)
  private netService: NetService

  
  /**
   * 获取当日新增案件
   */
  public getNewlyCaseCount() {
    return this.netService.send({
      server: domainService.homePageController.getNewlyCaseCount,
    })
  }
  
  /**
   * 待催收案件数量统计
   */
  public getWaitCollectCaseCount() {
    return this.netService.send({
      server: domainService.homePageController.getWaitCollectCaseCount,
    })
  }

  /**
   * 流出案件数量统计
   */
  public getOutFlowCaseCount() {
    return this.netService.send({
      server: domainService.homePageController.getOutFlowCaseCount,
    })
  }

  /**
   * 行动代码监控
   */
  public actionCodeMonitor(overduePeriod: number) {
    return this.netService.send({
      server: domainService.homePageController.actionCodeMonitor,
      data: {
        overduePeriod
      }
    })
  }

  /*
   * 获取催收员案件量
   */
  public getHomeCaseTotal() {
    return this.netService.send({
      server: domainService.homePageController.getHomeCaseTotal,
    })
  }

  /**
   * 催收员回款排行
   */
  public getCollectorRackIngData(data: any) {
    return this.netService.send({
      server: domainService.homePageController.getCollectorRackIngData,
      data
    })
  }
}
